<template>
  <div class="map-echart">
    <div ref="echarts" class="charts"></div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  data() {
    return {
      type: "bar",
    };
  },
  mounted() {
    this.initCharts();
  },
  methods: {
    initCharts() {
      let myChart = echarts.init(this.$refs.echarts);
      const option = {
        series: [
          {
            name: "1",
            type: "pie",
            data: [5, 20, 30],
          },
        ],
      };

      myChart.setOption(option);

      window.onresize = function () {
        myChart.resize();
      };
    },
  },
};
</script>

<style lang="scss" scoped>
.charts {
  width: 50px;
  height: 50px;
  // background-color: #cfcfcf;
}
</style>